package com.trainsmart.example.mdi.control
{
	import com.trainsmart.smartmvc.Context;
	import com.trainsmart.smartmvc.CtrlBase;
	
	import mx.core.Window;

	public class CloseWin extends CtrlBase
	{
		public function CloseWin(context:Context)
		{
			//TODO: implement function
			super(context);
		}
		
		override public function execute(request:Object=null, response:Function=null):void
		{
			if(request["winId"]==context.getInSession("winId")){
				context.sendCommandX("unregister",request);
				(context.attachUI as Window).close();
			}
		}
		
	}
}